Music Object Static Properties

 Property Name   Short Description 
Compatibility (read / write)
Music.getPlayerImagesPath A string, specifying the Web location of player control panel substitute graphics.
Music.ignoreJavaDisabled A boolean, specifying whether or not a prompt should be displayed when Java is disabled.
Music.installerOptions An array, containing customizable installer options that are to be passed to the Beatnik Player installer.
Music.showCompatibilityPrompt A boolean, specifying whether or not a prompt should be displayed when the installed player fails to meet the author's requirements.
Music.silentIfInadequate A boolean, specifying whether or not a page should be silent when the installed player fails to meet the author's requirements.
Compatibility (read only)
Music.hasPlayer A boolean indicating whether any version of the Beatnik Player is installed.
Music.clientKnown A boolean indicating whether or not the user's client (browser) is known by Music Object.
Music.clientName A string representing the name of the user's client (browser).
Music.clientPlatform A string representing the user's platform (operating system).
Music.clientSupported A boolean indicating if the user's browser / operating system is supported by the Beatnik Player.
Music.clientUpgradable A boolean indicating whether or not the Beatnik Player can be installed into the user's client (browser).
Music.clientVersion A string indicating the version number of the user's client (browser).
Music.playerType A string representing the type of player that is installed ('Plug-in' or 'ActiveX').
Music.playerVersion A string representing just the version number of the installed Beatnik Player.
Music.requiredMinVersion A string, specifying the overall minimum Beatnik Player version required by all sonification code modules on a page.
General
Music.embedDefaults An array, representing the default values for all of the Beatnik Player's supported embedding properties.
Music.enabled Acts as a "master switch" to enable or disable sonification of a page.
Music.instances An array of references to all the Music Object instances on a page.
Music.version A string indicating the version of the Music Object API that is being used.

Compatibility (read / write)

 Music.getPlayerImagesPath

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   string 
 Default Value   undefined 
 Access   read / write 
 

The Music.getPlayerImagesPath property is a String variable, specifying the Web location of graphics that can act as substitutes for the Beatnik Player control panel when the user does not have the player installed in their browser.

If you do not define this property and the user does not have the Beatnik Player installed, then Music Object will by default substitute the Beatnik Player control panel with a plain square area the same size as the control panel you're trying to embed, and containing a link for users to initiate the installation process.

For more information on using this property, consult the section Music Object Compatibility Aids.

 Music.ignoreJavaDisabled

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   boolean 
 Default Value   false 
 Access   read / write 
 

The Music.ignoreJavaDisabled property is a boolean variable, specifying whether or not a prompt should be displayed when Java is disabled in Netscape Navigator.

When this property is set to true, a prompt will not be displayed when Java is disabled. And when set to false, a prompt will be displayed when Java is disabled.

Netscape Navigator relies on Java as the means for connecting plug-ins and JavaScript in its LiveConnect technology. In turn, the Beatnik Player relies on LiveConnect for the scriptable control that makes it possible to sonify Web pages. Since a Web content developer will be investing time into enhancing their content to make use of the interactive features of the Beatnik Player, it is preferable that the user enable Java before continuing on through a sonified Web site.

However, it is also sometimes of paramount importance to certain Web site developers that users receive absolutely no prompts / alerts / warnings whatsoever, even if the user will experience only a shadow of the Web site that was actually designed. In cases like this, the Music.ignoreJavaDisabled property can be set to true to ensure that no prompt is displayed when users are browsing a Beatnik-enhanced Web page with Java disabled in Navigator.

Java is not used as the means for scripted control over ActiveX controls in Microsoft Internet Explorer, and so this property has no effect on the behavior of Music Object when the user is browsing with MSIE and the Beatnik ActiveX control. Java is also not required - even in Netscape Navigator - when an author is simply using the Music.magicEmbed function to embed non-scriptable player instances.

 Music.installerOptions

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   array 
 Default Value   n/a 
 Access   read / write 
 

The Music.installerOptions property is an array, containing customizable installer options that are to be passed to the Beatnik Player installer.

Installer options are set by defining elements of the Music.installerOptions array that are recognized by the Beatnik Player installer. For example, one of the options of the Beatnik Player installer is a Web URL that should be returned to when the install process has successfully been completed. This installer option can be set with a statement such as...

Music.installerOptions ['returnURL'] = 'http://www.my-domain.com/my-page.html';

In this example, the highlighted text indicates the text that should be substituted with your own value that is appropriate to your sonified Web site. It is also acceptable to set installer options by defining properties of the Music.installerOptions array in much the same way as one would define properties of an object, so the following syntax is also allowed...

Music.installerOptions.returnURL = 'http://www.my-domain.com/my-page.html';

The following installer options are recognized by the Beatnik Player installer...

 Music.requiredMinVersion

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   string 
 Default Value   an empty string 
 Access   read only 
 

The Music.requiredMinVersion read-only static property is a string variable, specifying the overall minimum Beatnik Player version required by all sonification code modules on a page.

Starting from Music Object version 3.3, the Music.requiredMinVersion static property is a read-only property and should not be set explicitly - the Music.requireMinPlayerVersion static method should be used instead.

For more information on using compatibility methods and properties, see the section Music Object Compatibility Aids.

NOTES
 Music.showCompatibilityPrompt

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   boolean 
 Default Value   true 
 Access   read / write 
 

The Music.showCompatibilityPrompt property is a boolean variable, specifying whether or not a prompt should be displayed when the installed player fails to meet the author's requirements.

When this property is set to true, a prompt will be displayed when the installed player fails the compatibility test. And when set to false, a prompt will not be displayed when the installed player is inadequate.

This property should be set before any calls are made to the Music.isPlayerCompatible or Music.magicEmbed static methods, or the magicEmbed, preloadEmbed, or stubEmbed methods. The best way to ensure this is to set the property in the code immediately following the SCRIPT tag that sources in the "music-object.js" file.

For example:

<SCRIPT SRC="music-object.js"></SCRIPT>

<SCRIPT LANGUAGE=JavaScript><!-- //

   Music.requireMinPlayerVersion ('1.3.2');
   Music.showCompatibilityPrompt = false;

// --></SCRIPT>

<!-- The rest of your document follows.... -->

For more information on using this property in conjunction with the other compatibility methods and properties, see the section Music Object Compatibility Aids.

NOTES
 Music.silentIfInadequate

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   boolean 
 Default Value   false 
 Access   read / write 
 

The Music.silentIfInadequate property is a boolean variable, specifying whether or not a page should be silent when the installed player fails to meet the author's requirements (as specified by the Music.requireMinPlayerVersion static method).

When this property is set to true, the page will be silent if the installed player fails the compatibility test. And when set to false (the default), all Beatnik Player instances will be embedded and activated as per normal, even though the page may specifically require a version of the Beatnik Player that is higher than the version installed on the user's system.

This property should be set before any calls are made to the Music.isPlayerCompatible or Music.magicEmbed static methods, or the magicEmbed, preloadEmbed, or stubEmbed methods. The best way to ensure this is to set the property in the code immediately following the SCRIPT tag that sources in the "music-object.js" file.

For example:

<SCRIPT SRC="music-object.js"></SCRIPT>

<SCRIPT LANGUAGE=JavaScript><!-- //

   Music.requireMinPlayerVersion ('1.3.2');
   Music.showCompatibilityPrompt = false;
   Music.silentIfInadequate = true;

// --></SCRIPT>

<!-- The rest of your document follows.... -->

For more information on using this property in conjunction with the other compatibility methods and properties, see the section Music Object Compatibility Aids.

NOTES
Compatibility (read only)

 Music.clientKnown

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   boolean 
 Access   read only 
 

The Music.clientKnown property is a boolean variable, indicating whether or not the user's client (browser) is known by Music Object.

A value of true indicates that the user's browser / operating system is known, and a value of false indicates that it is not known. This property can be used when manually performing compatibility testing using the Compatibility Methods that are built into the Music Object API. While in most cases a client that is known by Music Object will also be supported, this cannot be assumed. In order to find out for certain if the user's client is supported by Music Object, one should use the Music.clientSupported static property.

NOTES
 Music.clientName

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   string 
 Access   read only 
 

The Music.clientName property is a string variable, representing the name of the user's client (browser).

Possible string values for this property include...

 Music.clientPlatform

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   string 
 Access   read only 
 

The Music.clientPlatform property is a string variable, representing the user's platform (operating system).

This value does not relate necessarily to the Web browser being used. For instance, the Music.clientPlatform property will have the value Win32 if the user's machine is running Windows 95/98/2000/ME/NT, regardless of whether they are using Netscape Navigator or Microsoft Internet Explorer.

The possible values for this property are as follows....

Value Platform(s) Indicated
Win32 Windows 95
Windows 98
Windows 2000
Windows ME
Windows NT
MacPPC MacOS (all versions)
WebTV WebTV Internet Terminal
WebTV Plus Receiver

This property can be used when manually performing compatibility testing using the Compatibility Methods that are built into the Music Object API.

NOTES
 Music.clientSupported

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   boolean 
 Access   read only 
 

The Music.clientSupported property is a boolean variable, indicating whether or not the user's browser / operating system is supported by the Beatnik Player.

A value of true indicates that the user's browser / operating system is supported, and a value of false indicates that it is not supported. This property can be used when manually performing compatibility testing using the Compatibility Methods that are built into the Music Object API.

NOTES
 Music.clientUpgradable

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   boolean 
 Access   read only 
 

The Music.clientUpgradable property is a boolean variable, indicating whether or not the Beatnik Player can be installed into the user's client (browser).

A value of true indicates that the Beatnik Player can be installed, and a value of false indicates that the Beatnik Player cannot be installed. It may be possible for a particular client to be supported by the Music Object API, but for it not to be possible to install the Beatnik Player into that client if Music Object determines that the player is not already installed, or if the version of the player that is installed does not meet the minimum version requirement specified by Music.requiredMinVersion static property.

This property can be used when manually performing compatibility testing using the Compatibility Methods that are built into the Music Object API. For example, it would not make sense to attempt to initiate the download an installation of the player if the Beatnik Player cannot actually be installed into the user's client.

So, for example, instead of using the code...

  INCORRECT
if (!Music.hasMinVersion ('2.1')) {
   Music.installPlayer ();
}

...one should instead use the code...

  CORRECT
if (!Music.hasMinVersion ('2.1') && Music.clientUpgradable) {
   Music.installPlayer ();
}

Because the Music.hasMinVersion static method will return the value false when an installed version of the player does not meet the minimum version requirement specified by Music.requiredMinVersion static property, and also when the user's client is not supported at all and there is no player installed, one cannot simply indiscriminately call the Music.installPlayer method when the Music.hasMinVersion method returns false. One should only initiate the download process when the user's client fails the compatibility test and one is also certain that the player can be installed into their client.

If one does initiate the download process when there is either no Beatnik Player available for the user's client, or there is no way to install a component into the user's client (as is the case with some set-top boxes), then the user may be presented with a dialog from the player download site informing them that the player cannot be installed on their system. This, of course, would not be a desirable user experience. The correct approach, as shown in the sample code listing above, is to make the call to the Music.installPlayer method conditional upon the user not having the necessary version of the player and it also being possible to install the player into the user's client.

NOTES
 Music.clientVersion

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   string 
 Access   read only 
 

The Music.clientVersion property is a string variable, indicating the version number of the user's client (browser).

This property can be used when manually performing compatibility testing using the Compatibility Methods that are built into the Music Object API.

NOTES

In some cases, the version indicated by this property may be lower than the actual version number of the user's browser. This is because some browsers do not correctly report their version in the navigator.appVersion property. For example, in the case of Microsoft Internet Explorer 5.0, the Music.clientVersion property would be set to the string value "4.0", because this browser reports the value "4.0 (compatible; MSIE 5.0; Windows 98; DigExt)" for the navigator.appVersion property. Music Object ignores parenthetical information in the navigator.appVersion property, but this browser is actually hiding its true version number in parentheses.

NOTES
 Music.hasPlayer

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   boolean 
 Access   read only 
 

The Music.hasPlayer property is a boolean variable, indicating whether any version of the Beatnik Player at all is installed in the user's browser.

A value of true indicates that the user does have a version of the Beatnik Player installed, and a value of false indicates that they do not. This property can be used when manually performing compatibility testing using the Compatibility Methods that are built into the Music Object API.

 Music.playerType

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   string 
 Access   read only 
 

The Music.playerType property is a string variable, representing the type of player that is installed.

The value of this property depends on the browser that is being used, and can be either "Plug-in" (for Netscape Navigator on all platforms, and Microsoft Internet Explorer on MacOS) or "ActiveX" (for Microsoft Internet Explorer on the Windows operating system).

 Music.playerVersion

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Compatibility 
 Type   string 
 Access   read only 
 

The Music.playerVersion property is a string variable, representing just the version number of the installed Beatnik Player (eg. "1.3.2").

NOTES
General

 Music.embedDefaults

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Basic 
 Type   array 
 Access   read / write 
 

The Music.embedDefaults property is an array, representing the default values for all of the Beatnik Player's supported embedding properties.

This property provides a convenient way to set up default values for certain embedding properties so as to avoid having to specify the exact same values many times over in multiple calls to the magicEmbed instance method, or other embedding methods (such as the preloadEmbed and stubEmbed instance methods and the Music.magicEmbed static method).

As an example, the code...

myMusicObject1 = new Music ();
myMusicObject2 = new Music ();
myMusicObject3 = new Music ();
myMusicObject4 = new Music ();

myMusicObject1.magicEmbed (
   'SRC="my-file1.rmf" ' +
   'WIDTH=144 HEIGHT=15 DISPLAY=SONG ' +
   'LOOP=TRUE VOLUME=55'
);
myMusicObject2.magicEmbed (
   'SRC="my-file2.rmf" ' +
   'WIDTH=144 HEIGHT=15 DISPLAY=SONG ' +
   'LOOP=TRUE VOLUME=55'
);
myMusicObject3.magicEmbed (
   'SRC="my-file3.rmf" ' +
   'WIDTH=144 HEIGHT=15 DISPLAY=SONG ' +
   'LOOP=TRUE VOLUME=55'
);
myMusicObject4.magicEmbed (
   'SRC="my-file4.rmf" ' +
   'WIDTH=144 HEIGHT=15 DISPLAY=SONG ' +
   'LOOP=TRUE VOLUME=55'
);

...has the same effect as the code...

myMusicObject1 = new Music ();
myMusicObject2 = new Music ();
myMusicObject3 = new Music ();
myMusicObject4 = new Music ();

Music.embedDefaults.WIDTH = '144';
Music.embedDefaults.HEIGHT = '15';
Music.embedDefaults.DISPLAY = 'SONG';
Music.embedDefaults.LOOP = 'TRUE';
Music.embedDefaults.VOLUME = '55';

myMusicObject1.magicEmbed ('SRC="my-file1.rmf"');
myMusicObject2.magicEmbed ('SRC="my-file2.rmf"');
myMusicObject3.magicEmbed ('SRC="my-file3.rmf"');
myMusicObject4.magicEmbed ('SRC="my-file4.rmf"');

In the two sample code listings above, the highlighted text indicates the code that is needed in both cases to ensure that all instances are embedded with the same values for each of the WIDTH, HEIGHT, DISPLAY, LOOP, and VOLUME embedding properties.

Quick Updates

Looking at the two code listings, one thing that should be quite apparent is how much simpler it would be to update the second code listing (that is using the Music.embedDefaults static property) so that all of the instances now have the value 60 set for the VOLUME embedding property. All that would be needed would be to change the statement Music.embedDefaults.VOLUME = '55' to become Music.embedDefaults.VOLUME = '60'.

How Are stubEmbed and preloadEmbed Methods Affected?

Any default values set for embedding properties using the Music.embedDefaults static property are overridden by properties that are explicitly set by the stubEmbed and preloadEmbed embedding methods. For example, in the sample code listing below, only the VOLUME embedding property will be set to the default value that is stored in the Music.embedDefaults.VOLUME property.

myMusicObject = new Music ();

Music.embedDefaults.WIDTH = '144';
Music.embedDefaults.HEIGHT = '15';
Music.embedDefaults.HIDDEN = 'FALSE';
Music.embedDefaults.LOOP = 'FALSE';
Music.embedDefaults.AUTOSTART = 'FALSE';
Music.embedDefaults.VOLUME = '55';

myMusicObject.stubEmbed ('stub.rmf');

While the stubEmbed method does not explicitly specify a value for the VOLUME embedding property, it does explicitly specify values for the WIDTH, HEIGHT, HIDDEN, AUTOSTART and LOOP embedding properties. So, any default values set for these embedding properties using the Music.embedDefaults static property will have no effect when the stubEmbed method is used. Similarly, the preloadEmbed method also explicitly specifies values for the WIDTH, HEIGHT, HIDDEN, AUTOSTART and LOOP embedding properties.

Case-sensitivite!

When using the Music.embedDefaults static property to set default values for embedding properties, it is essential to always specify the embedding properties in all uppercase. If you attempt to set an embedding property's default value and do not use all uppercase, then your setting will simply be ignored.

In the following sample code listing, only the default value for the LOOP embedding property will be correctly set. All the other settings will have no effect.

  INCORRECT
Music.embedDefaults.Width = '144';
Music.embedDefaults.Height = '15';
Music.embedDefaults.display = 'SONG';
Music.embedDefaults.LOOP = 'TRUE';
Music.embedDefaults.volume = '55';

In order to successfully set the default values for these embedding properties, the code should correctly be...

  CORRECT
Music.embedDefaults.WIDTH = '144';
Music.embedDefaults.HEIGHT = '15';
Music.embedDefaults.DISPLAY = 'SONG';
Music.embedDefaults.LOOP = 'TRUE';
Music.embedDefaults.VOLUME = '55';

NOTES
 Music.enabled

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Basic 
 Type   boolean 
 Default Value   true 
 Access   read / write 
 

The Music.enabled property is a boolean variable, which acts as a "master switch" to enable or disable sonification of a page.

When this property is set to true, the page will be sonified as expected. However, when this property is set to false, all sonification of the page using Beatnik will be ignored. This includes all compatibility tests performed using the Compatibility Methods that are built into the Music Object API. Calls to methods of a Music Object instance for the sake of page sonification will not produce JavaScript errors when the sonification is disabled in this way.

When this property is set to false before any calls are made to the Music.isPlayerCompatible or Music.magicEmbed static methods, or the magicEmbed, preloadEmbed, or stubEmbed instance methods, then the compatibility tests will be ignored and space that would have been occupied by any Player control panels will instead be filled with transparent tables of the same dimensions to maintain the layout integrity of the page. In this case, no actual Player instances are embedded in the page, and since it is not possible to embed Player instances after the document has finished loading, it will not be possible to reverse the unsonified state by setting the Music.enabled property to true after the document has already loaded in. The only way then for the document to ever have sound is for it to be reloaded and for the Music.enabled property to be set to true at the time that the Player instances are embedded.

On the other hand, if the Music.enabled property is set to true at the time that Player instances are embedded, then sonification will be enabled as normal. In this case, setting the property to false later will effectively block any attempts to alter the state of any Player instances. In this condition, it is still possible to obtain state information about the instances using the "get" type methods, but it is not possible to alter the state of any instances using the "set" type methods or the transport control methods, such as play, pause, and stop. This is a convenient way to switch off the sonification of a page's user interface, since all attempts to instruct an instance to play musical notes, Groovoids, or music files will be blocked when the property is set false.

It's important to note that setting this property to false after a document has loaded in with sonification enabled will not stop music that is currently playing through Player instances, but will merely block further attempts to change the state of all Player instances. So, depending on the way you wish to use this property, you may need to use the stop method or the Music.stopAll static method before setting Music.enabled to false. Of course, if you first set the property to false and then try to use the stop or Music.stopAll methods, you will not succeed in stopping the music that's playing because having the property set to false will block all attempts to change the state of player instances, including attempts to stop them playing.

If you are only using this property as a means of disabling all sonification for a page, then the most effective way to use the property is to set it in the code immediately following the SCRIPT tag that sources in the "music-object.js" file, as follows...

<SCRIPT SRC="music-object.js"></SCRIPT>

<SCRIPT LANGUAGE=JavaScript><!-- //

   Music.enabled = false;

// --></SCRIPT>

<!-- The rest of your document follows.... -->

If you are also using Music Object extensions or language modules in your authoring, then it is perfectly acceptable to set the Music.enabled property after all extensions and language modules have been sourced in, but before any player instances are embedded in the page or any calls to the compatibility methods are made, as in the following example...

<SCRIPT SRC="music-object.js"></SCRIPT>
<SCRIPT SRC="music-object-l-portuguese.js"></SCRIPT>
<SCRIPT SRC="music-object-x-debug.js"></SCRIPT>
<SCRIPT SRC="music-object-x-groups.js"></SCRIPT>

<SCRIPT LANGUAGE=JavaScript><!-- //

   Music.enabled = false;

// --></SCRIPT>

<!-- The rest of your document follows.... -->

 Music.instances

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Basic 
 Type   array 
 Access   read only 
 

The Music.instances static property is an array of references to all of the Music Object instances that have been created on a page.

This array can be used to perform an operation on all Music Object instances on a page by programmatically iterating through the elements of the array. Each element of the Music.instances array is a reference to a Music Object instance that was created, in the order in which they were created on the page. Consider the following example...

notePlayer = new Music ():
groovoidPlayer = new Music ();
backgroundMusicPlayer = new Music ();

In this example, the element Music.instances [0] would be a reference to the instance notePlayer, the element Music.instances [1] would be a reference to the instance groovoidPlayer, and the element Music.instances [2] would be a reference to the instance backgroundMusicPlayer. Now, in this example, because the element Music.instances [1] is a reference to the object instance groovoidPlayer, then statement Music.instances [1].play ('UI-Choice1') would be equivalent to the statement groovoidPlayer.play ('UI-Choice1').

An example application of the Music.instances static property would be a page that creates multiple instances and loads music into each instance using the preloadEmbed method. A "PLAY ALL" button on the page could then call a function that would start all the instances on the page playing, regardless of how many instances were created. This function would look as follows...

function playAll () {
   for (var instanceNo = 0; instanceNo < Music.instances.length; instanceNo++) {
      Music.instances [instanceNo].play ();
   }
}

Because this function will start all Music Object instances playing, regardless of how many instances were created on the page, the function is a more flexible approach for implementing the "PLAY ALL" button and allows more instances to be created as need without having to update the code that gets called when the user clicks the "PLAY ALL" button on the page.

NOTES
 Music.version

 
 CATEGORY   Static Property 
 MODULE   Music Object Core 
 Music Object Component - Basic 
 Type   string 
 Access   read only 
 

The Music.version property is a string variable, representing the version of the Music Object API that is being used (eg. "3.3.0").

NOTES